from django.db import models

# Create your models here.

class Book(models.Model):
    name = models.CharField(max_length = 50)
    author = models.CharField(max_length = 50)
    bookcover = models.ImageField('book cover',upload_to='bookimages/%Y/%m/%d')
    publisher = models.CharField(max_length = 50)
    pub_date = models.DateTimeField('date published')
    
    
    def __unicode__(self):
        return self.name
